/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
// pfonts.hpp - PegFont structure and default font assignments.
// Author: Kenneth G. Maxwell
//
// Copyright (c) 1997-2000 Swell Software 
//              All Rights Reserved.
//
// Unauthorized redistribution of this source code, in whole or part,
// without the express written permission of Swell Software
// is strictly prohibited.
//
// Notes:
//
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/

#ifndef _PEGFONTS_
#define _PEGFONTS_

/*--------------------------------------------------------------------------*/
// PegFont structure definition:

struct PegFont
{
    PEGUBYTE   Type;            // bit-flags defined below
    PEGUBYTE   Ascent;          // Ascent above baseline
    PEGUBYTE   Descent;         // Descent below baseline
    PEGUBYTE   CharHeight;      // total height of character
    PEGUBYTE   PreSpace;        // leading space
    PEGUBYTE   PostSpace;       // trailing space
    PEGUBYTE   LineHeight;      // total height with pre and post space
    PEGUSHORT  BytesPerLine;    // total bytes (width) of one scanline
    PEGUSHORT  FirstChar;       // first character present in font (page)
    PEGUSHORT  LastChar;        // last character present in font (page)
    PEGUSHORT  *pOffsets;        // bit-offsets for variable-width font
    PegFont    *pNext;           // NULL unless multi-page Unicode font
    PEGUBYTE   *pData;    
};


struct OldPegFont               // previous ( < 2.0 release) font structure
{
    PEGUBYTE   Type;            // bit-flags defined below
    PEGUBYTE   Ascent;          // Ascent above baseline
    PEGUBYTE   Descent;         // Descent below baseline
    PEGUBYTE   Height;          // total height of character
    PEGUSHORT  BytesPerLine;    // total bytes (width) of one scanline
    PEGUSHORT  FirstChar;       // first character present in font (page)
    PEGUSHORT  LastChar;        // last character present in font (page)
    PEGUSHORT  *pOffsets;        // bit-offsets for variable-width font
    PegFont    *pNext;           // NULL unless multi-page Unicode font
    PEGUBYTE   *pData;           // character bitmap data array
};

/*--------------------------------------------------------------------------*/
// Flags for Font Type:

#define PFT_VARIABLE 0x01   // Variable-Width font (1-bpp, standard)
#define PFT_OUTLINE  0x02   // Outline font (2-bpp)
#define PFT_ALIASED  0x04   // Anti-aliased (4-bpp) font
#define PFT_ZIPPED   0x08
#define PFT_BMPFONT  0x10   // Bitmap character font (8-bpp)
#define PFT_FREETYPE 0x20   // font is TrueType (Freefype font face)

#define IS_VARWIDTH(a) (a->Type & PFT_VARIABLE)
#define IS_OUTLINE(a)  (a->Type & PFT_OUTLINE)
#define IS_ALIASED(a)  (a->Type & PFT_ALIASED)
#define IS_ZIPPED(a)   (a->Type & PFT_ZIPPED)
#define IS_BMPFONT(a)  (a->Type & PFT_BMPFONT)
#define IS_FREETYPE(a) (a->Type & PFT_FREETYPE)



#endif // sentry

